/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4 -*- */
/* vi: set expandtab shiftwidth=4 tabstop=4: */

#include <stdint.h>
#include "XorHashMacro.h"

extern const uint32_t hashwords[];

/** \brief hash based on 2 16-bit memory lookups
 *
 * Author: Nick Galbreath  nickg [at] modp [dot] com
 * License: Public domain
 */
class NGalbreathHash32_xorplus1  {
public:
    uint32_t hash32(uint32_t key) const
    {
        // alt is 16,17,4,10,7,23
        key += (key << 16);
        key ^= (key >> 17);
        key += (key << 4);
        key ^= (key >> 5);
        key += (key << 8);
        key ^= (key >> 13);
        return key;
    }

    const char* name() const
    {
        return "NickGalbreath_plusxor1";
    }

    XORHASH
};
